public class test525 {
    public static void main(String[] args) {
        for (int maxI = 10000; maxI <= 100000; maxI += 10000) {
            double pi = 0;
            for (int i = 1; i <= maxI; i++) {
                int sign = (i % 2 == 1) ? 1 : -1;
                double term = sign * 1.0 / (2 * i - 1);
                pi += term;
            }
            pi *= 4; 
            System.out.printf("当i=%d时，π的值为：%.10f%n", maxI, pi);
        }
    }
}

